package router

import (
	"gf/app/service"

	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
)

func init() {
	s := g.Server()
	// 分组路由注册方式
	s.Group("/", func(group *ghttp.RouterGroup) {
		group.Middleware(
			service.Middleware.CORS,
		)
	})

	s.BindHandler("/hello", func(r *ghttp.Request) {
		r.Response.Write("hello gf!")
	})
}
